package com.yudean.esb.mapper.esb;

import com.yudean.esb.domain.esb.EsbRecvServiceTransaction;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
@Mapper
public interface EsbRecvServiceTransactionMapper {
    void insert(EsbRecvServiceTransaction transaction);

    List<EsbRecvServiceTransaction> select(String serviceID);

    void update(EsbRecvServiceTransaction transaction);

    void delete(EsbRecvServiceTransaction transaction);


    /**
     * 根据服务ID查询与之关联的事务号
     *
     * @param serviceID
     * @return
     */
    List<EsbRecvServiceTransaction> selectByServiceId(@Param("serviceID") String serviceID, @Param("type") String type);

    /**
     * 选取待处理的事务
     *
     * @param serviceID
     * @return
     */
    List<EsbRecvServiceTransaction> selectNoneHandled(@Param("serviceID") String serviceID);

    /**
     * 判断事务是否已经完成全部包的发送
     *
     * @param transactionID
     * @return
     */
    int isFullPackage(@Param("transactionID") String transactionID);

}
